//
//  UserOrderLogisticsController.m
//  SmallElephant
//
//  Created by Faith on 2022/12/24.
//

#import "UserOrderLogisticsController.h"
#import "UserOrderLogisticsShipInfo.h"
#import "UserOrderLogisticsOrderInfo.h"

@interface UserOrderLogisticsController ()

/// 物流信息视图
@property (nonatomic, strong) UserOrderLogisticsShipInfo *shipInfoView;

/// 订单信息视图
@property (nonatomic, strong) UserOrderLogisticsOrderInfo *orderInfoView;


@end

@implementation UserOrderLogisticsController

- (void)viewDidLoad {
    // 顶部背景占位
    UIView *placeHolderView = [[UIView alloc] init];
    [self.view addSubview:placeHolderView style:@"position: absolute; width: 100%; height: 143px; background: url(bg-my-order@3x);"];
    [super viewDidLoad];
    
    // 设置自定义导航栏标题
    [self setTitleText:@"交易成功"];
    // 添加列表组件
    [self.scrollViewContent addSubview:self.shipInfoView style:@"display: flex; flex-direction: column;"];
    // 添加订单信息视图
    [self.scrollViewContent addSubview:self.orderInfoView style:@"display: flex; background: #FFFFFF; margin-top: 10px; padding: 10px; padding-bottom: --safe-area-bottom;"];
    // 加载数据
    [self loadData];
}

/// 懒加载物流信息
- (UserOrderLogisticsShipInfo *)shipInfoView {
    if(!_shipInfoView) {
        _shipInfoView = [[UserOrderLogisticsShipInfo alloc] init];
        
        
    }
    return _shipInfoView;
}

/// 懒加载订单视图
- (UserOrderLogisticsOrderInfo *)orderInfoView {
    if(!_orderInfoView) {
        _orderInfoView = [[UserOrderLogisticsOrderInfo alloc] init];
    }
    return _orderInfoView;
}


- (void)loadData {
    
    // 设置物流单号
    [self.shipInfoView setShipOrderNumber:@"SF0260522438222"];
    
    // 设置物流轨迹
    [self.shipInfoView setShipOrbitData:@[
        @{
            @"status": @"已签收",
            @"time": @"2024-09-23 10:36",
            @"summary": @"【昆明市】您的快递已签收。如有疑问请联系业务员：15362656236，感谢您使用顺丰快递，期待再次为您服务！"
        },
        @{
            @"status": @"待取件",
            @"time": @"2024-09-23 10:36",
            @"summary": @"【昆明市】快件已在 快递超市的【蓝湾俊园5栋107店】暂放，取件地址：蓝湾俊园5栋107，请及时取件，如有疑问勤联系业务员: 15362656236"
        },
        @{
            @"status": @"派送中",
            @"time": @"2024-09-23 10:36",
            @"summary": @"【昆明市】昆明市经济开发区的业务员，正在为您派件，如有疑问勤联系业务员: 15362656236"
        },
        @{
            @"status": @"运输中",
            @"time": @"2024-09-23 10:36",
            @"summary": @"【昆明市】快件已到达昆明经济开发区"
        },
        @{
            @"time": @"2024-09-23 10:36",
            @"summary": @"【昆明市】快件已发往昆明经济开发区"
        },
        @{
            @"time": @"2024-09-23 10:36",
            @"summary": @"【昆明市】快件已到达昆明转运中心"
        },
        @{
            @"time": @"2024-09-23 10:36",
            @"summary": @"【临沧市】快件已发往昆明转运中心"
        },
        @{
            @"time": @"2024-09-23 10:36",
            @"summary": @"【临沧市】快件已到达临沧转运中心"
        },
        @{
            @"time": @"2024-09-23 10:36",
            @"summary": @"【缅甸-腊戌市】快件已发往临沧转运中心"
        },
        @{
            @"time": @"2024-09-23 10:36",
            @"summary": @"【缅甸-腊戌市】快件已到达腊戌转运中心"
        },
        @{
            @"time": @"2024-09-23 10:36",
            @"summary": @"【缅甸-伊洛瓦底】快件已发往腊戌转运中心"
        },
        @{
            @"status": @"已发货",
            @"time": @"2024-09-23 10:36",
            @"summary": @"伊洛瓦底集散中心已揽收"
        },
        @{
            @"status": @"已发货",
            @"time": @"2024-09-23 10:36",
            @"summary": @"伊洛瓦底集散中心已揽收"
        },
        @{
            @"status": @"已下单",
            @"time": @"2024-09-23 10:36",
            @"summary": @"商品已下单"
        }
    ]];
    
    // 设置订单信息
    [self.orderInfoView setData:@{
        @"shopName": @"靓丽衣族旗舰店",
        @"platform": @"tm",
        @"createTime": @"2024-11-20 12:11",
        @"title": @"睡不着了啊啊啊啊[苦涩][苦涩][苦涩]吃完外卖喝了两个小啤啤，一点困意都没了[跪了][跪了][跪了] ​睡不着了啊啊啊啊[苦涩][苦涩][苦涩]吃完外卖喝了两个小啤啤，一点困意都没了[跪了][跪了][跪了] ​",
        @"amount": @(18.23),
        @"number": @(2),
        @"spec": @[@"米白色长袖", @"均码"],
        @"cover": @"https://wx1.sinaimg.cn/orj360/002R448Kgy1huwcjn0pllj62c0340u0y02.jpg"
    }];
}


@end
